# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>

pkgname=deepin-session-shell
pkgver=6.0.13
pkgrel=1
pkgdesc='Deepin desktop-environment - session-shell module'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/dde-session-shell"
license=('GPL3')
# qt5-tools: for qdbus executable
depends=('deepin-daemon' 'deepin-network-core' 'deepin-qt5integration' 'deepin-wallpapers'
         'gsettings-qt' 'liblightdm-qt5' 'lightdm' 'qt5-tools' 'startdde' 'kwayland5'
         'deepin-pw-check' 'dtkcore' 'dtkgui' 'dtkwidget' 'libx11' 'libxcursor'
         'qt5-svg' 'qt5-base' 'libxi' 'dconf' 'qt5-base' 'libxtst' 'glibc' 'libxfixes' 'pam'
         'gcc-libs' 'libxrandr' 'libxcb' 'qt5-x11extras')
makedepends=('cmake' 'gmock' 'gtest' 'ninja')
conflicts=('deepin-session-ui<5')
provides=('lightdm-deepin-greeter')
groups=('deepin')
source=("https://github.com/linuxdeepin/dde-session-shell/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('8479288ebffdf7e0b17b5dc11a39316cfd631626e2475173690cf713ebaa4bdd161877288b59682f01ed7963448d570db98eb56481da00627a4ac8d58df5625a')

prepare() {
  cd dde-session-shell-$pkgver
  # We don't have common-auth on Arch
  sed -i 's/common-auth/system-login/' files/pam.d/dde-lock
}

build() {
  cd dde-session-shell-$pkgver
  cmake . -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc
  ninja
}

package() {
  cd dde-session-shell-$pkgver
  DESTDIR="$pkgdir" ninja install

  chmod +x "$pkgdir"/usr/bin/deepin-greeter
}
